package com.playball.lottery.frm.yhzx;

import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.KeyEvent;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.Window;
import android.widget.Button;
import android.widget.TextView;

import com.playball.lottery.R;
import com.playball.lottery.ApplicationData;
import com.playball.lottery.base.BaseActivity;
import com.playball.lottery.frm.ads.AdActivity;


public class JddRegisterSucessActivity extends BaseActivity {

	private TextView tv_title;
	private TextView btn_title_left;
	private TextView btn_title_right;
	private TextView btn_bottom_left;

	private TextView tv_contratulations;
	private Button btn_compelete_account;
	private Button btn_look_to_homefrm;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		Log.d("JddRegisterSucessActivity", "->onCreate");
		super.onCreate(savedInstanceState);
		this.requestWindowFeature(Window.FEATURE_NO_TITLE);
		setContentView(R.layout.jdd_register_success);

		tv_title = (TextView) findViewById(R.id.top_title_info);
		btn_title_left = (TextView) findViewById(R.id.top_title_back);
		btn_title_right = (TextView) findViewById(R.id.top_title_right_btn);
		// btn_bottom_left = (TextView) findViewById(R.id.bottom_left_btn);
		btn_compelete_account = (Button) findViewById(R.id.btn_compelete_account);
		btn_look_to_homefrm = (Button) findViewById(R.id.btn_just_look_to_homefrm);
		tv_contratulations = (TextView) findViewById(R.id.tv_congratulations);

		tv_title.setText("注册账户");
		btn_title_left.setVisibility(View.INVISIBLE);
		btn_title_right.setVisibility(View.INVISIBLE);
		// btn_bottom_left.setVisibility(View.INVISIBLE);
		tv_contratulations.setText(ApplicationData.getInstance().getUserName());

		btn_look_to_homefrm.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View v) {
				// TODO Auto-generated method stub
				/*
				 * Intent intent = new Intent(JddRegisterSucessActivity.this,
				 * JddMainActivity.class); startActivity(intent);
				 */
				Intent data = new Intent();
				data.putExtra("whichButton", 0);
				setResult(RESULT_OK, data);

				finish();
			}
		});

		btn_compelete_account.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View v) {
				// TODO Auto-generated method stub
				// 跳转到完善账户
				Intent intent = new Intent(JddRegisterSucessActivity.this, SecurityCenterActivity.class);
				startActivity(intent);

				Intent data = new Intent();
				data.putExtra("whichButton", 1);
				setResult(RESULT_OK, data);

				finish();
			}
		});
	}

	public void onResume() {
		super.onResume();
		
	}

	public void onPause() {
		super.onPause();
		
	}

	@Override
	public boolean onKeyDown(int keyCode, KeyEvent event) {
		if (keyCode == KeyEvent.KEYCODE_BACK) {
			return true;
		} else {
			return super.onKeyDown(keyCode, event);
		}
	};

}
